-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state: Fix failing code deployment in Frontier #824
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #824 +/- ##
==========================================
+ Coverage 97.98% 98.02% +0.04%
==========================================
Files 116 116
Lines 11370 11457 +87
==========================================
+ Hits 11141 11231 +90
+ Misses 229 226 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0081c26
to
83e2efc
Compare
const auto created = compute_create_address(To, pre.get(To).nonce); | ||
expect.post[created].code = bytes{}; // code deployment failure creates empty account | ||
expect.post[created].nonce = 0; | ||
expect.post[created].storage[0x00_bytes32] = 0x01_bytes32; // storage stays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frontier was crazy time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this affects EIP-7610 nowadays :)
https://ethereum-magicians.org/t/eip-7610-revert-creation-in-case-of-non-empty-storage
83e2efc
to
a160ae3
Compare
In Frontier when CREATE fails to deploy the code because of the deployment cost the creation behaves as it has been successful although the created account has empty code. Fix the CREATE instruction by returning the address of the created account instead of the null address. The gas refund is also applied as in the case of successful code deployment. Geth agrees with this but this situation probably never happened on Mainnet.
a160ae3
to
eb2cb4b
Compare
In Frontier when CREATE fails to deploy the code because of the deployment cost the creation behaves as it has been successful although the created account has empty code.
Fix the CREATE instruction by returning the address of the created account instead of the null address.
The gas refund is also applied as in the case of successful code deployment. Geth agrees with this but this situation probably never happened on Mainnet.